<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
use yii\widgets\LinkPager;
?>
<div style="margin: 15px 0px;">
    <div>
        <?php $form=ActiveForm::begin()?>
        <?=$form->field($data['artM'],'title',['inputOptions'=>['style'=>'width:25%;height:33px;margin-left:15px;font-size:16px;float:left;','placeholder'=>'文章标题']])->label(false)?>
        <?=$form->field($data['artM'],'status')->dropDownList(['0'=>'禁用文章','1'=>'启用文章'],['prompt'=>'请选择','style'=>'width:25%;float:left;margin-left:6px;margin-right:6px;'])->label(false)?>
        <?=Html::submitButton('查询',['class'=>'btn btn-primary'])?>
        <?php ActiveForm::end()?>
    </div>
    <div style="clear: both;"></div>
</div>
<table class="table table-striped">
    <thead>
    <tr>
        <th>序号</th>
        <th>标题</th>
        <th>描述</th>
        <th>添加时间</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach ($data['model'] as $key => $value) {?>
        <tr>
            <th scope="row"><?=$value['id']?></th>
            <td><?=$value['title']?></td>
            <td><?=$value['description']?></td>
            <td><?=date('Y-m-d H:i:s',$value['add_time'])?></td>
            <td>
            <?php
                if($value['status']==0){?>
                    <span style="color: red;">禁用</span>
                <?php }elseif($value['status']==1){ ?>
                    <span style="color: green">启用</span>
            <?php }?>
            </td>
            <td>
                <a href="<?=Url::to(['test/set-status', 'id' => $value['id'], 'value' => 1])?>" class="btn btn-info">查看</a>
                <a href="<?=Url::to(['article/upda-form', 'id' => $value['id']])?>" class="btn btn-warning">修改</a>
                <a href="<?=Url::to(['test/del', 'id' => $value['id']])?>" class="btn btn-danger">删除</a>
            </td>
        </tr>
    <?php }?>
    </tbody>
</table>
<?=LinkPager::widget(['pagination'=>$data['page']]);?>

